home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 25
/
Cream of the Crop 25.iso
/
os2
/
kzr0597.zip
/
KZR0.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1997-02-14
|
3KB
|
113 lines
/* kzr0.CMD */
"@ echo off"
Numeric Digits 48
pi=3.141592653589793238462643383279502884197169399375105820975
ND=50
Call RxFuncAdd 'SysLoadFuncs', RexxUtil, 'SysLoadFuncs'
Call SysLoadFuncs
Pfd=SysSearchPath("PATH", "kzr0.cmd")
lp=LastPos("\", Pfd)
Pfd=DelStr(Pfd, 1+lp)
buferg=Pfd||"Ergebnis.DAT"
bufND =Pfd||"NDZahl.DAT"
ret=LineOut(bufND, ND)
zz = LineIn(buferg, 1)
z=zz
Call charout(buferg)
Call SysFileDelete buferg
parse arg str; str=strip(str)
parse UPPER value str with s2 ';' v1 ',' v2
if (length(str)= 0) then do; "view.exe" Pfd||"KZR.INF"; EXIT;end
if Pos("DIVGANZ", s2) > 0 then Call Flt3 s2; else s3=s2
if Pos("DIVREST", s3) > 0 then Call Flt4 s3; else s4=s3
if length(V1) > 0 & length(V2) > 0 then
do
/* Hier ist zweimal ein Semikolon erforderlich, */
/* da Trennung von drei REXX-Anweisungen */
st=v1||";"||v2||"; "||"z = "||s2
Signal NV
end
if length(v1) > 0 & length(v2) = 0 then
do
/* Hier ist einmal ein Semikolon erforderlich, */
/* da Trennung von zwei REXX-Anweisungen */
st=v1||"; "||"z = "||s2
Signal NV
end
if length(v2) > 0 & length(v1) = 0 then
do
/* Hier ist einmal ein Semikolon erforderlich, */
/* da Trennung von zwei REXX-Anweisungen */
st=v2||"; "||"z = "||s2
Signal NV
end
NV:
Numeric Digits ND
interpret st
if DataType(z, N) = 1 then
do
Numeric Digits ND
zz=Format(z)
st10=ErgFormat(zz)
end
else st10=z
say; say st10
ret=LineOut(buferg, st10)
Call charout(bufND); Call SysFileDelete bufND
Call charout(bufMsg); Call SysFileDelete bufMsg
Dummy=MinNDA()
EXIT
Flt3:
parse arg s2
i=1; s3.i=s2
A3:
j=i+1
l3.i=Pos("DIVGANZ", s3.i); if l3.i > 0 then Signal w31
w31:
if l3.i=0 then Signal w3e
b3.i=SubStr(s3.i, l3.i, 7)
s3.i=DelStr(s3.i, l3.i, 7)
if b3.i=="DIVGANZ" then n3.i="%"
s3.j=Insert(n3.i, s3.i, l3.i-1); s3=s3.j
i=i+1
signal A3
w3e:
Return
Flt4:
parse arg s3
i=1; s4.i=s3
A4:
j=i+1
l4.i=Pos("DIVREST", s4.i); if l4.i > 0 then Signal w41
w41:
if l4.i=0 then Signal w4e
b4.i=SubStr(s4.i, l4.i, 7)
s4.i=DelStr(s4.i, l4.i, 7)
if b4.i=="DIVREST" then n4.i="//"
s4.j=Insert(n4.i, s4.i, l4.i-1); s4=s4.j
i=i+1
signal A4
w4e:
Return
ErgFormat:
Procedure
arg u
if Pos(".", u)>0 & Pos("E", u)=0 then
do
do forever
lu=length(u)
if Pos("0", u, lu) > 0 then u=DelStr(u, lu); else leave
end
lu=length(u)
if Pos(".", u) = lu then u=DelStr(u, lu)
end
Return(u)